<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<h1>JS 数值</h1>
	<hr>
	<script>
		var num = 134;
		017;  // 8进制   0~7 
   		var num = 0b110;  // 2进制   0~1
    	var num = 0xff;  // 16进制   0~9a~f
    	var num = 3e3; // 科学计数法
    	var num = 3e-3;

    	//Not a Numder
    	var num = Nan;

    	// Not a Number
    var num = NaN;
    console.log('值:' , num);
    console.log('类型:', typeof(num));

    console.log(NaN + 100);

    if (NaN == NaN) {
        console.log('Yes');
    } else {
        console.log('No');
    }

    if (NaN) {
        console.log('Yes');
    } else {
        console.log('No');
    }

    // 数值转换  
    // Number()  parseInt()  parseFloat()

    var a = 'hi';
    var a = '5';
    var a = '52abc';
    var a = '5.45abc';
    var a = '5.45.4456abc';
    var a = '';
    var a = true;
    var a = false;
    var a = 'false';
    var a = null;
    var a = undefined;

    // var n = Number(a);
    var n = parseInt(a);
    // var n = parseFloat(a);

    console.log('值:' , n);
    console.log('类型:', typeof(n));


    // isNaN()
    console.log(isNaN(50));
    console.log(isNaN('50'));
    console.log(isNaN('50hh'));
	</script>
</body>
</html>